#!/usr/bin/python3

try:
    t = int(input())
    for i in range(t):
        d = [int(item) for item in input().split()]
        if d[0] * d[0] + d[1] * d[1] + d[2] * d[2] >= d[3] * d[3]:
            print("Case #%d: YES" % int(i+1))
        else:
            print("Case #%d: NO" % int(i+1))

except ValueError:
    pass
except EOFError:
    pass
except MemoryError:
    pass
